<?php
// P. Couchet 06/06/2011

session_start();
set_time_limit (0);
ini_set('memory_limit', '512M');

// Fichier de configuration en fonction du serveur
include('../config/config.php');

$dsn='mysql:host='.$host.';port='.$port.';dbname='.$dbname;

// Haut de page
include('../templates/'.$template.'/up.php');
// Connexion, création de $a, inclusion de model.php
include('../action/statusAction.php');

// Default Tab
// Onglet par défaut, le premier de la liste menu
if (empty($_GET) and empty($_POST)){
	$defaultMenu = array_keys($menu);
	$defaultMenu = $defaultMenu[0];
	$_GET[$defaultMenu]=true;
}

// Home About
if(isset($_GET['p'])) include('../templates/'.$template.'/pInfo.php');
// Display all
if(isset($_GET['t'])){
	include('../action/tAction.php');
	include('../templates/'.$template.'/tForm.php');
	if(isset($itemNumber) and $itemNumber > 0) include('../templates/'.$template.'/results.php');
}
// Simple search
if(isset($_GET['s'])){
	if(!empty($_GET['s'])) include('../action/sAction.php');
	include('../templates/'.$template.'/sForm.php');
	if(isset($itemNumber) and $itemNumber > 0) include('../templates/'.$template.'/results.php');
}
// Advanced search
if(isset($_GET['a'])){
	include('../action/aAction.php');
	include('../templates/'.$template.'/aForm.php');
	if(isset($itemNumber) and $itemNumber > 0) include('../templates/'.$template.'/results.php');
}
// List
if(isset($_GET['l'])){
	if(!empty($_GET['l'])) include('../action/lAction.php');
	include('../templates/'.$template.'/lForm.php');
	if(isset($itemNumber) and $itemNumber > 0) include('../templates/'.$template.'/results.php');
}
// Statistics
if(isset($_GET['x'])){
	include('../action/xAction.php');
	include('../templates/'.$template.'/xInfo.php');
}
// Contact
if(isset($_GET['h'])) include('../templates/'.$template.'/hInfo.php');
// Mentions légales
if(isset($_GET['c'])) include('../templates/'.$template.'/cInfo.php');
// Accessibilité
if(isset($_GET['e'])) include('../templates/'.$template.'/eInfo.php');

include('../templates/'.$template.'/down.php');

?>
